package huxibianjie.com.lbscandroid.ui;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import huxibianjie.com.lbscandroid.model.AccountDetailsModel;
import huxibianjie.com.lbscandroid.model.CountDailyModel;
import huxibianjie.com.lbscandroid.model.RankingsModel;
import huxibianjie.com.lbscandroid.model.SuperInviteRecordModel;
import huxibianjie.com.lbscandroid.model.SuperiorInfoModel;
import huxibianjie.com.lbscandroid.model.UserModel;
import huxibianjie.com.lbscandroid.model.VersionModel;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface Service {
    /**
     * 版本检查
     */
    @GET("daily/getNewEdition")
    Call<VersionModel> getVersionInfo(@Query("type") String type);

    /**
     * 通过验证码登录
     */
    @FormUrlEncoded
    @POST("user/login")
    Call<UserModel> loginByCode(@Field("phone") String phone,
                                @Field("valicode") String verification_code);

    /**
     * 通过密码登录
     */
    @FormUrlEncoded
    @POST("user/accountLogin")
    Call<UserModel> loginByPass(@Field("phone") String phone,
                                @Field("password") String password);

    /**
     * 补全密码
     */
    @FormUrlEncoded
    @POST("user/completionPassword")
    Call<UserModel> completionPassword(@Field("phone") String phone,
                                       @Field("password") String password);

    /**
     * 修改密码
     */
    @FormUrlEncoded
    @POST("user/updatePassword")
    Call<String> updatePassword(@Field("phone") String phone,
                                @Field("valicode") String verification_code,
                                @Field("password") String password);

    /**
     * 获取用户信息
     */
    @GET("daily/getUserByPhone")
    Call<UserModel> getUserInfo(@Query("phone") String phone);

    /**
     * 用户注册
     */
    @FormUrlEncoded
    @POST("user/register")
    Call<UserModel> register(@Field("phone") String phone,
                             @Field("valicode") String verification_code,
                             @Field("password") String password,
                             @Field("invitationCode") String invitationCode);

    /**
     * 用户注册
     */
    @FormUrlEncoded
    @POST("user/register")
    Call<UserModel> register(@Field("phone") String phone,
                             @Field("valicode") String verification_code,
                             @Field("password") String password
    );

    /**
     * 提交数据
     * ok
     */
    @FormUrlEncoded
    @POST("daily/submitStep")
    Call<Map<String, String>> submitStep(@Field("userId") String userId,
                                         @Field("step") long step);

    /**
     * 关注社群
     * ok
     */
    @FormUrlEncoded
    @POST("user/communityTask")
    Call<Map<String, String>> communityTask(@Field("userId") String userId,
                                            @Field("code") String code);

    /**
     * 关注订阅号
     * ok
     */
    @FormUrlEncoded
    @POST("user/followWechat")
    Call<Map<String, String>> followWechat(@Field("userId") String userId,
                                           @Field("code") String code);

    /**
     * 邀请好友生成邀请码
     * daizuo
     */
    @FormUrlEncoded
    @POST("user/randomValidationCode")
    Call<String> randomValidationCode(@Field("userId") String userId);


    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("user/sentcode")
    Call<Map<String, String>> sentCode(@Field("phone") String phone);

    /**
     * 提现
     */
    @FormUrlEncoded
    @POST("user/savePurseAddress")
    Call<Map<String, String>> savePurseAddress(@Field("userId") String userId,
                                               @Field("addressUrl") String addressUrl,
                                               @Field("lbscNumber") String lbscNumber);

    /**
     * 获取一周运动情况
     */
    @FormUrlEncoded
    @POST("user/getHistoryData")
    Call<ArrayList<CountDailyModel>> getHistoryData(@Field("userId") String userId);

    /**
     * 获取今日排行榜
     */
    @FormUrlEncoded
    @POST("user/getTodayRankingsV2")
    Call<RankingsModel> getTodayRankings(@Field("userId") String userId);

    /**
     * 提交钱包地址
     */
    @FormUrlEncoded
    @POST("user/updatePurseAddress")
    Call<String> updatePurseAddress(@Field("userId") String userId,
                                    @Field("addressUrl") String addressUrl);


    /**
     * 用户提步提交时间
     */
    @FormUrlEncoded
    @POST("user/getUserSubmitTime")
    Call<Long> getUserSubmitTime(@Field("userId") String userId);

    /**
     * 获取邀请上级的记录
     */
    @FormUrlEncoded
    @POST("user/getSuperiorInfo")
    Call<SuperiorInfoModel> getSuperiorInfo(@Field("userId") String userId);

    /**
     * 绑定邀请码
     */
    @FormUrlEncoded
    @POST("user/bindingInvitationCode")
    Call<String> bindingInvitationCode(@Field("userId") String userId, @Field("code") String code);

    /**
     * 邀请记录
     */
    @FormUrlEncoded
    @POST("user/getInvitationRecord")
    Call<SuperInviteRecordModel> getInvitationRecord(@Field("userId") String userId, @Field("pageNo") int pageNo, @Field("pageSize") int pageSize);

    /**
     * 获取是否有邀请人
     */
    @FormUrlEncoded
    @POST("user/homeGetInvitationRecord")
    Call<String> getHomeInvitationRecord(@Field("userId") String userId);

    /**
     * 账户明细
     */
    @FormUrlEncoded
    @POST("user/getCurrencyRecordList")
    Call<List<AccountDetailsModel>> getCurrencyRecordList(@Field("userId") String userId, @Field("type") String type, @Field("pageNo") int pageNo, @Field("pageSize") int pageSize);

}
